import os

# 目录配置
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SCREENSHOT_DIR = os.path.join(BASE_DIR, 'screenshots')
REPORT_DIR = os.path.join(BASE_DIR, 'testReport')
LOG_DIR = os.path.join(BASE_DIR, 'logs')

# 浏览器配置
BROWSER_TYPE = 'firefox'  # 可选: 'firefox', 'chrome', 'edge'

# 测试目标配置
BASE_URL = "https://www.baidu.com"  # 默认URL，可以通过命令行参数覆盖

# 日志配置
LOG_LEVEL = 'INFO'
LOG_FORMAT = '%(asctime)s - %(levelname)s - %(message)s'

# 报告配置
REPORT_TITLE = 'Web UI自动化测试报告'

def init_directories():
    """初始化所需的目录"""
    for directory in [SCREENSHOT_DIR, REPORT_DIR, LOG_DIR]:
        if not os.path.exists(directory):
            os.makedirs(directory) 